<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>系统配置参数</title>
<script language="javascript">
	var searchconfig = false;
	function Nav() {
		if (window.navigator.userAgent.indexOf("MSIE") >= 1)
			return 'IE';
		else if (window.navigator.userAgent.indexOf("Firefox") >= 1)
			return 'FF';
		else
			return "OT";
	}
	function $Obj(objname) {
		return document.getElementById(objname);
	}
	function ShowConfig(em, allgr) {
		if (searchconfig)
			location.reload();
		for ( var i = 1; i <= allgr; i++) {
			if (i == em)
				$Obj('td' + i).style.display = (Nav() == 'IE' ? 'block'
						: 'table');
			else
				$Obj('td' + i).style.display = 'none';
		}
		$Obj('addvar').style.display = 'none';
	}

	function ShowHide(objname) {
		var obj = $Obj(objname);
		if (obj.style.display != "none")
			obj.style.display = "none";
		else
			obj.style.display = (Nav() == 'IE' ? 'block' : 'table-row');
	}

	function backSearch() {
		location.reload();
	}
	function getSearch() {
		var searchKeywords = $Obj('keywds').value;
		var myajax = new DedeAjax($Obj('_search'));
		myajax.SendGet('sys_info.php?dopost=search&keywords=' + searchKeywords)
		$Obj('_searchback').innerHTML = '<input name="searchbackBtn" type="button" value="返回" id="searchbackBtn" onclick="backSearch()"/>'
		$Obj('_mainsearch').innerHTML = '';
		searchconfig = true;
	}
</script>
<link rel="stylesheet" type="text/css" href="../css/style1.css" />
<link rel="stylesheet" type="text/css" href="../css/base.css" />
<link rel="stylesheet" type="text/css" href="../css/indexbody.css" />
<script type="text/javascript" src="../js/frame.js"></script>
<script type="text/javascript">
	window.onload = function() {
		document.getElementById("hide").style.display = "block";
		document.getElementById("sc").style.display = "none";
		document.getElementById("vip").style.display = 'none';
		document.getElementById("mb").style.display = 'none';
		document.getElementById("sys").style.display = 'none';
	}
</script>
</head>
<body background='../images/allbg.gif' leftmargin='8' topmargin='8'>
	<div id="container">
		<jsp:include page="../header.jsp"></jsp:include>
		<div style="float:left; width:195px; height: 550px">
			<jsp:include page="../leftnav.jsp"></jsp:include>
		</div>
		<div
			style="float:left; overflow-y:scroll; overflow-x:hidden; width: 785px; height: 550px;">

			<div style="min-width:780px">
				<table width="776" border="0" cellpadding="2" cellspacing="1"
					bgcolor="#D6D6D6" align="center" height="57">
					<tr >
						<td height="28" background="../images/tbg.gif"
							style="padding-left:10px;"><b>GGCMS系统配置参数：</b>
						</td>
					</tr>
					<tr>
						<td height="24" bgcolor="#ffffff" align="right">
							  <a href="#"
							onClick="ShowHide('addvar')">添加新变量</a>
						</td>
					</tr>
					<tr id="addvar" style="display:none">
						<td height="24" bgcolor="#ffffff" align="center"><form
								name="fadd" action="sysconfig!addsysConfig.action" method="post">
								<input type='hidden' name='dopost' value='add' />
								<table width="98%" border="0" cellspacing="0" cellpadding="0">
									<tr>
										<td width="12%" height="26">变量名称：</td>
										<td width="38%" align="left"><input name="sysConfig.name"
											type="text" id="nvarname" class="npvar" style="width:80%" />
										</td>
										<td width="12%" align="center">变量值：</td>
										<td width="38%" align="left"><input name="sysConfig.value"
											type="text" id="nvarvalue" class="npvar" style="width:80%" />
										</td>
									</tr>
									<tr>
									
										<td height="26">参数说明：</td>
										<td align="left"  colspan="3"><input type="text" name="sysConfig.info"
											id="varmsg" class="npvar" style="width:80%" />
										</td>
									</tr>
									<tr>
										<td colspan="4" align="center"><input name="imageField"
											type="image" src="../images/button_ok.gif" width="60"
											height="22" border="0" class="np" /><img
											src="../images/button_reset.gif" width="60" height="22"
											style="cursor:pointer" onClick="document.fadd.reset()" /></td>
									</tr>
								</table>
							</form>
						</td>
					</tr>
				</table>
				<s:form name="form1" method="post"
					action="sysconfig!doUpdate.action">
					<table width="98%" border="0" cellpadding="0" cellspacing="0"
						style="margin-top:10px" bgcolor="#D6D6D6" align="center">
						<tr>
							<div id="_mainsearch">
								<table width="100%" style='' id="td1" border="0" cellspacing="1"
									cellpadding="1" bgcolor="#cfcfcf">
									<tr align="center" bgcolor="#FBFCE2" height="25">
										<td width="300">参数说明</td>
										<td>参数值</td>
										<td width="220">变量名</td>
									</tr>

									<s:iterator value="sysConfigs" status="stat">
										<s:hidden name="sysConfigs[%{#stat.index}].id"
											value="%{sysConfigs[#stat.index].id}" />
										<s:hidden name="sysConfigs[%{#stat.index}].name"
											value="%{sysConfigs[#stat.index].name}" />
										<s:hidden name="sysConfigs[%{#stat.index}].info"
											value="%{sysConfigs[#stat.index].info}" />

										<tr align="center" height="25" bgcolor="#ffffff">
											<td width="300"><label
												name='sysConfigs[%{#stat.index}].info"/>'><s:property
														value="sysConfigs[#stat.index].info" /> </label></td>
											<td align="left" style="padding:3px;"><input type='text'
												name="sysConfigs[${stat.index }].value"
												id='edit___cfg_basehost'
												value="<s:property value='sysConfigs[#stat.index].value' />"
												style='width:80%' />
											</td>
											<td><label name='sysConfigs[%{#stat.index}].name"/>'><s:property
														value="sysConfigs[#stat.index].name" /> </label></td>
										</tr>
									</s:iterator>
									<tr>
										<td colspan="3" align="center"><input name="imageField"
											type="image" src="../images/button_ok.gif" width="60"
											height="22" border="0" class="np" /><img
											src="../images/button_reset.gif" width="60" height="22"
											style="cursor:pointer" onClick="document.form1.reset()" /></td>
									</tr>
								</table>
								</s:form>
							</div>
							</td>
						</tr>
					</table>
			</div>
		</div>
	</div>
</body>
</html>